<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>

<body>
  <script>
    console.log(1)

    setTimeout(function () {
      console.log(2)
    }, 0)

    const p = new Promise((resolve, reject) => {
      resolve(1000)
    })

    p.then(data => {
      console.log(data)
    })

    console.log(3)
  </script>
</body>

</html>